/**
 * (c) 2014 StreamSets, Inc. All rights reserved. May not
 * be copied, modified, or distributed in whole or part without
 * written consent of StreamSets, Inc.
 */
package com.streamsets.pipeline.lib.parser.log;

public class Constants {

  public static final String REG_EX_STRING = "(\\S+)";
  public static final String REG_EX_REQUEST_LINE = "(\\S+ \\S+ \\S+)";
  public static final String REG_EX_REQUEST_TIME = "\\[([\\w:/]+\\s[+\\-]\\d{4})\\]";
  public static final String REG_EX_STATUS = "(\\d{3})";
  public static final String REG_EX_NUMBER = "(\\d+)";
  public static final String REG_EX_URL = "([^\"]*)";
  public static final String REG_EX_PERCENTAGE = "%";
  public static final String REG_EX_NEW_LINE = "\\\\n";

  public static final String GROK_PATTERNS_FILE_NAME = "grok-patterns";
  public static final String GROK_APACHE_ERROR_LOG_PATTERNS_FILE_NAME = "apache-error-log";
  public static final String GROK_TOMCAT_LOG_PATTERNS_FILE_NAME = "tomcat-log";
  public static final String GROK_JAVA_LOG_PATTERNS_FILE_NAME = "java-log";
  public static final String GROK_LOG4J_LOG_PATTERNS_FILE_NAME = "log4j-log";

  public static final String GROK_COMMON_APACHE_LOG_FORMAT = "%{COMMONAPACHELOG}";
  public static final String GROK_COMBINED_APACHE_LOG_FORMAT = "%{COMBINEDAPACHELOG}";
  public static final String GROK_APACHE_ERROR_LOG_FORMAT = "%{APACHE_ERROR_LOG}";
  public static final String GROK_LOG4J_LOG_FORMAT = "%{LOG4JLOG}";

  //Field names generated by grok patterns, listed here to be used in unit tests

  public static final String ORIGINAL_LINE = "originalLine";
  public static final String TIMESTAMP = "timestamp";
  public static final String CLIENTIP = "clientip";
  public static final String MESSAGE = "message";
  public static final String LOGLEVEL = "loglevel";

  public static final String USER_IDENT = "ident";
  public static final String USER_AUTH = "auth";
  public static final String VERB = "verb";
  public static final String REQUEST = "request";
  public static final String HTTPVERSION = "httpversion";
  public static final String RAWREQUEST = "rawrequest";
  public static final String RESPONSE = "response";
  public static final String BYTES = "bytes";

  public static final String REFERRER = "referrer";
  public static final String AGENT = "agent";

  public static final String SEVERITY = "severity";
  public static final String JAVACLASS = "class";
  public static final String CATEGORY = "category";
  public static final String THREAD = "thread";
  public static final String RELATIVETIME = "relativetime";

}
